package com.sailing.xjpb.ipaas.client.entity.bo;

import com.sailing.xjpb.common.tree.annotation.Tree;
import com.sailing.xjpb.common.tree.annotation.TreeField;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 组织机构树形结构BO
 */
@Tree(id = "orgId", pid = "parentId", label = "orgName", code = "orgCode")
@Data
public class OrganizationTreeBO implements Serializable {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * ORG_ID
	 */
	private String orgId;
	/**
	 * PARENT_ID
	 */
	private String parentId;

	/**
	 * ORG_NAME
	 */
	private String orgName;

	/**
	 * ORG_CODE
	 */
	private String orgCode;
	/**
	 * private String sysOrgCode; /** STATUS
	 */
	@TreeField
	private String description;

	/**
	 * SHORT_NAME
	 */
	@TreeField
	private String shortName;
	/**
	 * SPELL_CODE
	 */
	@TreeField
	private String spellCode;
	/**
	 * LEAF
	 */
	private String leaf;

	private List<OrganizationTreeBO> children;

	/**
	 * 组织分类 综治 公安
	 */
	@TreeField
	private String ext1;
	/**
	 * EXT2
	 */
	@TreeField
	private String ext2;
	/**
	 * 组织分类 综治办 综治委
	 */
	@TreeField
	private String ext3;
	/**
	 * 组织层级
	 */
	@TreeField(propName = "type")
	private String ext10;
	/**
	 * 区分树每一层是什么类型
	 */
	private String type;
	/**
	 * 注销状态
	 */
	@TreeField
	private String cancelState;
	/**
	 * 数据状态
	 */
	@TreeField
	private String dataState;
	/**
	 * 房屋用途
	 */
	@TreeField
	private String houseUseType;

	@TreeField
	private String businessType;

	@TreeField
	private String buildingClassify;

	@TreeField
	private String longitude;

	@TreeField
	private String latitude;

	public void addChildrenList(List<OrganizationTreeBO> organizationTreeBOList) {
		if (this.children == null) {
			this.children = new ArrayList<>();
		}
		this.children.addAll(organizationTreeBOList);
	}

}
